package com.zjuee.web.auth.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zjuee.base.model.common.auth.Role;
import com.zjuee.base.model.common.auth.UserRole;
import com.zjuee.service.auth.vo.MenuVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author wu liang
 * @since 1.0
 */
@Mapper
public interface UserRoleMapper extends BaseMapper<UserRole> {

    /**
     * 获取此用户已分配的所有角色
     */
    List<Role> findAllRolesByUserId(Long userId);


    /**
     * 根据用户id，获取用户的所有资源
     */
    List<MenuVo> findAllMenuByUserId(@Param("userId") Long userId);

}
